import { showNotify } from "vant";

//封装全局toast
export const Notify = (msg, type = "default") => {
  switch (type) {
    case "default":
      showNotify({
        message: msg,
        type: "primary",
        duration: 2000,
      });
      break;
    case "success":
      showNotify({
        message: msg,
        type: "success",
        duration: 2000,
      });
      break;
    case "danger":
      showNotify({
        message: msg,
        type: "danger",
        duration: 2000,
      });
      break;
    case "warning":
      showNotify({
        message: msg,
        type: "warning",
        duration: 2000,
      });
      return Notify;
  }
};
